import Utils from '../utils.js'
import { iframeMediaOrigin } from '../api.config.js'
export default {
	init: function() {
		let _this = this;
		let obj = {
			nickNameObj: $(".nickName"),
			rtmpUdpObj: $(".rtmpUdp")
		}
		// 保存
		$(".saveBtn").on("click", function(e) {
			let nickName = obj.nickNameObj.val();
			let rtmpUdp = obj.rtmpUdpObj.val();
			if(!Utils._spaceCheck(nickName)) {
				$.message({message: '输出名称不能为空!', type: 'info'});
				return;
			}
			if(!Utils._spaceCheck(rtmpUdp)) {
				$.message({message: 'Rtmp地址不能为空!', type: 'info'});
				return;
			}
			_this.saveAuthInfo(obj);
		});
		// 取消
		$(".quitBtn,.closeBtn").on("click", function(e) {
			Utils._closeParent("otherAdd");
		});
	},
	saveAuthInfo: function(obj) {
		// let token = Utils._getAesString(streamName, pwd_1, iv_1);
		// let obj = {
		// 	nickName: nickName,
		// 	isAuto: isAuto,
		// 	type: "Y",
		// 	token: token,
		// 	rtmpId: serverUrl,
		// 	shareType: isAuto == '0' ? 1: 0
		// }
	}
}